package extreme.tddscaffold;
public class GildedRose {
    private String name;
    private int sellIn;
    private int quality;


    public GildedRose(String name, int sellIn, int quality) {
        this.name = name;
        this.sellIn = sellIn;
        this.quality = quality;

    }

    public GildedRose() {

    }

    public int CommodityPrice(){
        quality=20;
        if(name=="BackstagePass"){
            if(sellIn>10){
                return quality;
            }else if(sellIn<=10&&sellIn>5){
                for (int i = 10; i >=sellIn; i--) {
                    quality+=2;
                }
                return quality;
            }else if(sellIn<=5){
                for (int i = 5; i >=sellIn; i--) {
                    quality+=2;
                }
            }else if(sellIn<0){
                quality=0;
            }
            return quality;
        }
        return quality;
    }
}
